package com.mszlu.news.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mszlu.news.dao.dos.Archives;
import com.mszlu.news.dao.pojo.Article;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ArticleMapper extends BaseMapper<Article> {


    List<Archives> listArchives();


    IPage<Article> listArticle(Page<Article> page,
                               Long categoryId,
                               Long tagId,
                               String year,
                               String month);

    /**
     * 通过作者id查找文章
     * @param authorId
     * @return
     */
    List<Article> listArticle1(Long authorId);

    /**
     * 搜索框查询
     * @param title
     * @param summary
     * @return
     */
    List<Article> selectArticle(String title,String summary);

    List<Article> listhotArticleByTag(Long tagId);
}
